package com.ziq.zcamp.view

import android.content.Context
import android.graphics.Typeface
import android.view.Gravity
import net.lucode.hackware.magicindicator.buildins.UIUtil
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView

class PlaceDetailPagerTitleView : SimplePagerTitleView {

    constructor(context: Context?) : super(context){
        gravity = Gravity.CENTER_HORIZONTAL or Gravity.BOTTOM
    }


    override fun onSelected(index: Int, totalCount: Int) {
        super.onSelected(index, totalCount)
        typeface = Typeface.defaultFromStyle(Typeface.BOLD)
        textSize = 15f
        val padding = UIUtil.dip2px(context, 10.0)
        setPadding(0, 0, 0, padding)
    }

    override fun onDeselected(index: Int, totalCount: Int) {
        super.onDeselected(index, totalCount)
        typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
        textSize = 14f
        val padding = UIUtil.dip2px(context, 12.0)
        setPadding(0, 0, 0, padding)
    }
}